Skip to content

Instantly share code, notes, and snippets.

@x1unix
x1unix / docker-compose.yml
Last active June 2, 2024 09:31
pihole+traefik
version: "3"
services:
traefik:
image: traefik:v2.10
container_name: 'traefik'
command:
- '--log.level=DEBUG'
- '--api.insecure=true'
- '--api.dashboard=true'
@stkent
stkent / android_studio_shortcuts.md
Last active June 2, 2024 09:29
Android Studio Shortcuts (Mac)

Android Studio Shortcuts (Mac)

Notes:

  • Two of the most useful shortcuts utilize the Fn (function) keys. It is therefore recommended that you enable the "Use all F1, F2, etc. keys as standard function keys" option [System Preferences > Keyboard].
  • Be sure to enable the Mac OS X 10.5+ keymap in Android Studio [Preferences > Keymap].
  • A fairly complete shortcut list can be found here.

Useful symbols:

@krisbolton
krisbolton / fix-USB-showing-up-as-two-partitions.md
Last active June 2, 2024 09:26
How to fix a USB drive showing up as two drives (fragmented into multiple partitions) on Windows

How to fix a USB drive showing up as two drives (fragmented into multiple partitions) on Windows:

  1. Hold the Windows key and press X, select PowerShell (Admin), select Yes to the pop-up. You can also use Command Prompt.
  2. In the Powershell interface type diskpart to enter the disk partition tool.
  3. Type list disk to see all disks listed.
  4. Select the USB drive by typing select disk [NUMBER]. Be careful to select the correct drive.
  5. Type clean. An error will occur if you have the drive folder open, close the window and repeat the command if this happens.
  6. Type create partition primary.
  7. Type format fs=ntfs quick to format the drive (you can also choose to set fs=fat32).
  8. Type active.
def on_received_number(receivedNumber):
basic.show_string("" + str((receivedNumber)))
radio.on_received_number(on_received_number)
radio.set_group(2)
@patriciogonzalezvivo
patriciogonzalezvivo / GLSL-Noise.md
Last active June 2, 2024 09:14
GLSL Noise Algorithms

Please consider using http://lygia.xyz instead of copy/pasting this functions. It expand suport for voronoi, voronoise, fbm, noise, worley, noise, derivatives and much more, through simple file dependencies. Take a look to https://github.com/patriciogonzalezvivo/lygia/tree/main/generative

Generic 1,2,3 Noise

float rand(float n){return fract(sin(n) * 43758.5453123);}

float noise(float p){
	float fl = floor(p);
  float fc = fract(p);
@mathcodes
mathcodes / dsa_pattern.md
Last active June 2, 2024 09:14
14 DSA Patterns to Master

14 Coding Patterns To Master

This is a collection of coding patterns I have learned to solve not only some of the most common problems, but the 14 patterns (yes, there are way more than 14, but the point here is taking 6 months of preparation and condensing it into a 30 minute read that would not take more than 1-2 weeks to master. I have found these problems and patterns to be the most useful in that the data structures and algorithms are used in many other problems and become familiar over time. Good luck!

Please feel free to comment if you got some value or find any errors!

Thanks!

Table of Contents

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
@vncsna
vncsna / bash_strict_mode.md
Created June 6, 2021 01:59 — forked from mohanpedala/bash_strict_mode.md
set -e, -u, -o, -x pipefail explanation

set -e, -u, -o, -x pipefail

The set lines

  • These lines deliberately cause your script to fail. Wait, what? Believe me, this is a good thing.
  • With these settings, certain common errors will cause the script to immediately fail, explicitly and loudly. Otherwise, you can get hidden bugs that are discovered only when they blow up in production.
  • set -euxo pipefail is short for:
set -e
set -u
@AlexV525
AlexV525 / init.gradle.kts
Last active June 2, 2024 09:01
Mirroring Gradle repositories
// Thanks to: https://gist.github.com/bennyhuo/af7c43cc4831661193605e124f539942
val urlMappings = mapOf(
"https://dl.google.com/dl/android/maven2" to "https://mirrors.tencent.com/nexus/repository/maven-public/",
"https://repo.maven.apache.org/maven2" to "https://mirrors.tencent.com/nexus/repository/maven-public/",
"https://plugins.gradle.org/m2" to "https://mirrors.tencent.com/nexus/repository/gradle-plugins/"
)
fun RepositoryHandler.mirroring() {
all {
@viruseg
viruseg / .Manually Convert World to Screen Position in Unity with Burst.cs
Last active June 2, 2024 09:00
Manually Convert World to Screen Position in Unity with Burst. The code is intended for the Burst compiler, which does the same thing as Camera.WorldToScreenPoint.
//camera-like projection matrix
var cameraData = new CameraDataForBurst(camera);
//or
//projection matrix for the rendering target of a given size
var cameraData = new CameraDataForBurst(camera, 320, 240);
var worldPoint = new float3(10, 10, 0);
var screenPointWithZ = cameraData.WorldToScreenPointWithZ(worldPoint);
var screenPoint = cameraData.WorldToScreenPoint(worldPoint);